<template>
  <div class="search">
    <f-form ref="form" :action="api.delayrisk" :form-key="this.formItem.delayriskId" >
      <f-form-item label="理赔编号"  name="delayriskNo" dataType="${formField.dataType}"   :value="formItem.delayriskNo" />
      <f-form-item label="物品Id"  name="goodsId" dataType="${formField.dataType}"   :value="formItem.goodsId" />
      <f-form-item label="被保险人数量"  name="insurantNumber" dataType="number"   :value="formItem.insurantNumber" />
      <f-form-item label="未成年人数量"  name="minorNumber" dataType="number"   :value="formItem.minorNumber" />
      <f-form-item label="开始时间"  name="startTime" dataType="${formField.dataType}"   :value="formItem.startTime" />
      <f-form-item label="结束时间"  name="endTime" dataType="${formField.dataType}"   :value="formItem.endTime" />
      <f-form-item label="联系电话"  name="phone" dataType="${formField.dataType}"   :value="formItem.phone" />
      <f-form-item label="预约者"  name="userId" dataType="${formField.dataType}"   :value="formItem.userId" />
      <f-form-item label=""  name="orderdetailId" dataType="${formField.dataType}"   :value="formItem.orderdetailId" />
      <f-form-item label="是否申请理赔"  name="isApply" dataType="number"   :value="formItem.isApply" />
      <f-form-item label=""  name="appointmentState" dataType="number"   :value="formItem.appointmentState" />
      <f-form-item label="延误险理赔审核状态（1审核中，2审核通过，3审核拒绝）"  name="isCheck" dataType="number"   :value="formItem.isCheck" />
      <f-form-item label="理赔申请日期"  name="applyDate" dataType="${formField.dataType}"   :value="formItem.applyDate" />
      <f-form-item label="理赔数量"  name="applyNum" dataType="number"   :value="formItem.applyNum" />
      <f-form-item label=""  name="soureType" dataType="number"   :value="formItem.soureType" />
      <f-form-item label="理赔处理时间"  name="handleDate" dataType="${formField.dataType}"   :value="formItem.handleDate" />
      <f-form-item label="是否删除"  name="deleted" dataType="number"   :value="formItem.deleted" />
      <f-form-item label="更新人"  name="updateUser" dataType="${formField.dataType}"   :value="formItem.updateUser" />
      <f-form-item label="更新时间"  name="updateTime" dataType="${formField.dataType}"   :value="formItem.updateTime" />
      <f-form-item label="创建人"  name="createUser" dataType="${formField.dataType}"   :value="formItem.createUser" />
      <f-form-item label="创建时间"  name="createTime" dataType="${formField.dataType}"   :value="formItem.createTime" />
    </f-form>
  </div>
</template>
<script>
  import api from './js/api'
  export default {
    name: 'delayriskForm',
    props: {},
    data() {
      return {
        refs:this.$refs,
        api:  Object.assign(api, this.api),
        isAdd: true,//是否是添加模式
        loaded: false,//是否加载完成
        formItem: this.getFormItem()
      }
    },
    methods: {
      getFormItem() {
        return {
          delayriskId: '',
          delayriskNo: '',
          goodsId: '',
          insurantNumber: '',
          minorNumber: '',
          startTime: '',
          endTime: '',
          phone: '',
          userId: '',
          orderdetailId: '',
          isApply: '',
          appointmentState: '',
          isCheck: '',
          applyDate: '',
          applyNum: '',
          soureType: '',
          handleDate: '',
          deleted: '',
          updateUser: '',
          updateTime: '',
          createUser: '',
          createTime: ''
        }
      },
      //表单赋值
      setData(data) {
        this.$refs.form.resetFields()
        this.formItem = this.getFormItem()
        if (data && data.delayriskId) {
          let params={
              delayriskId:data.delayriskId
          }
          this.refs['form'].getDetails(params,(data)=>{
             this.formItem=data
             this.loaded = true
          })
          this.isAdd = false
        } else {
          this.loaded = true
        }
      },
      //提交表单
      handleSubmit(callback) {
        this.$refs.form.submit({  }, callback)
      }
    },
    created() {
    },
    components: {}
  }
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
